package com.chen.tliaswebtest.mapper;

import com.chen.tliaswebtest.pojo.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author chen
 * @version 1.0
 * @create_date 2025/7/24
 * 部门表映射接口
 */
@Mapper
public interface DeptMapper {
    @Select("select id, name, create_time, update_time from dept order by update_time desc")
    List<Dept> list();

    void add(Dept dept);

    @Delete("delete from dept where id = #{id}")
    void deleteDeptById(Integer id);

    void update(Dept dept);

    @Select("select id, name, create_time, update_time from dept where id = #{id}")
    Dept selectById(Integer id);
}
